<?php

// +----------------------------------------------------------------------
// | Admin Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2024 ThinkAdmin [ thinkadmin.top ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/think-plugs-admin
// | github 代码仓库：https://github.com/zoujingli/think-plugs-admin
// +----------------------------------------------------------------------

declare(strict_types=1);

namespace app\tools\controller;

use app\tools\model\TableContentModel;
use app\tools\model\TableModel;
use think\admin\Controller;
use think\admin\helper\QueryHelper;


/**
 * 三方接口对接
 * @class Base
 * @package app\admin\controller
 */
class Table extends Controller
{
    /**
     * 数据表列表
     * @auth true
     * @menu true
     * @author Lihongqi
     * @DateTime 2024-10-16
     * @return void
     */
    public function index ()
    {

        TableModel::mQuery()->layTable(function () {

            $this->title = '表管理';

        }, function (QueryHelper $query) {

            // 数据列表搜索过滤
            $query->like('title,comment')->dateBetween('create_at');
            $query->order('id desc');
        });

    }


    /**
     * 表添加
     * @auth true
     * @menu true
     */
    public function addList ()
    {
        TableContentModel::mQuery()->layTable(function () {

        }, function (QueryHelper $query) {

            // 数据列表搜索过滤
            $query->like('title,comment')->dateBetween('create_at');
            $query->order('id desc');
        });
    }

}
